{
STYLE_CHANGED,
POPUP_MENU,
+ RESOURCE_SCALE_CHANGED,
LAST_SIGNAL
};
st_widget_parent_set (ClutterActor *widget,
ClutterActor *old_parent)
{
+ StWidget *self = ST_WIDGET (widget);
ClutterActorClass *parent_class;
ClutterActor *new_parent;
/* don't send the style changed signal if we no longer have a parent actor */
if (new_parent)
- st_widget_style_changed (ST_WIDGET (widget));
+ st_widget_style_changed (self);
}
static void
G_STRUCT_OFFSET (StWidgetClass, popup_menu),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
+
+ /**
+ * StWidget::resource-scale-changed:
+ * @widget: the #StWidget
+ *
+ * Emitted when the paint scale that the widget will be painted as
+ * changed.
+ */
+ signals[RESOURCE_SCALE_CHANGED] =
+ g_signal_new ("resource-scale-changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (StWidgetClass, resource_scale_changed),
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
}
/**
return ST_WIDGET_PRIVATE (actor)->inline_style;
}
+/**
+ * st_widget_get_resource_scale:
+ * @widget: A #StWidget
+ * @resource_scale: (out): return location for the resource scale
+ *
+ * Retrieves the resource scale for this #StWidget, if available.
+ *
+ * The resource scale refers to the scale the actor should use for its resources.
+ */
+gboolean
+st_widget_get_resource_scale (StWidget *widget,
+ float *resource_scale)
+{
+ return clutter_actor_get_resource_scale (CLUTTER_ACTOR (widget),
+ resource_scale);
+}
+
static void
st_widget_name_notify (StWidget *widget,
GParamSpec *pspec,
st_widget_style_changed (widget);
}
+static void
+st_widget_resource_scale_notify (StWidget *widget,
+ GParamSpec *pspec,
+ gpointer data)
+{
+ g_signal_emit (widget, signals[RESOURCE_SCALE_CHANGED], 0);
+}
+
static void
st_widget_reactive_notify (StWidget *widget,
GParamSpec *pspec,
/* connect style changed */
g_signal_connect (actor, "notify::name", G_CALLBACK (st_widget_name_notify), NULL);
+ g_signal_connect (actor, "notify::resource-scale", G_CALLBACK (st_widget_resource_scale_notify), NULL);
g_signal_connect (actor, "notify::reactive", G_CALLBACK (st_widget_reactive_notify), NULL);
g_signal_connect (actor, "notify::first-child", G_CALLBACK (st_widget_first_child_notify), NULL);
/* signals */
void (* style_changed) (StWidget *self);
void (* popup_menu) (StWidget *self);
+ void (* resource_scale_changed) (StWidget *self);
/* vfuncs */
GList * st_widget_get_focus_chain (StWidget *widget);
void st_widget_paint_background (StWidget *widget);
+gboolean st_widget_get_resource_scale (StWidget *widget,
+ float *resource_scale);
/* debug methods */
char *st_describe_actor (ClutterActor *actor);